local Human = require'entities.human'

local Captain = {}
Captain.mt = { __index = Captain }
setmetatable( Captain, Human.mt )


function Captain.initialize( spc, ship, spawn_at_cp )
	local lf
	
	if spc == 'human' then
		lf = Human.new ( 'captain', 100, 'base_actor', ship )
	else -- other species go here
	end
	setmetatable(lf, Captain.mt)
	lf.station = 'cp'
	if ship then
		lf:acclimate(ship, spawn_at_cp)
	end
	
	lf.class = 'captain'
	
	return lf

end


function Captain.new( spc, ship, spawn_at_cp )

	local o = Captain.initialize( spc, ship, spawn_at_cp )
	
	
	return o

end

function Captain:acclimate(ship, spawn_at_cp )
	--coroutine.yield()
	local a = 1
	--local ship = self:get_ship()
	
	local x, y = ship.stations.cp[1].prop:getLoc()
	
	x = x --* TILE_SIZE
	y = y --* TILE_SIZE
	self.station_x = x
	self.station_y = y
	
	--self:seekLoc(x, y, 0.001)
	self:do_job( spawn_at_cp )

end

return Captain